//
//  Operation.m
//  10-10
//
//  Created by 钟纪旺 on 16/11/30.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import "Operation.h"

@interface Operation ()<UIScrollViewDelegate>{

    UIImageView *iv;
}

@end

@implementation Operation

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIScrollView *scroll = [[UIScrollView alloc]initWithFrame:self.view.bounds];
    scroll.delegate = self;
    scroll.maximumZoomScale = 4;
    scroll.minimumZoomScale = 1;
    [self.view addSubview:scroll];
    
    UIImage *img = [UIImage imageNamed:@"010.jpg"];
    iv = [[UIImageView alloc]initWithImage:img];
    iv.frame = scroll.bounds;
    iv.contentMode = UIViewContentModeScaleAspectFit;
    
    [ iv addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTap:)]];
    [scroll addSubview:iv];
    
}
- (void)onTap:(id)sender{

    [self dismissViewControllerAnimated:YES completion:nil];

}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{

    return iv;

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
